import request from '@/utils/request'
//获取店铺信息
export const getStoreList = () => request({
  url: '/stores/storeslist',
  method: 'get'
})
//删除店铺信息
export const removeStore = id => request({
  url: `/stores/delete/${id}`,
  method: 'delete'
})
//获取行业信息
export const getTradeList = () => request({
  url: '/trade/list',
  method: 'get'
})
//获取当前id行业信息
export const getTrade = id => request({
  url: '/trade/list/' + id,
  method: 'get'
})
//添加行业信息
export const addTrade = data => request({
  url: '/trade/add',
  method: 'post',
  data
})

export const removeTrade = id => request({
  url: '/trade/delete/' + id,
  method: 'delete'
})
export const updateTrade = data => request({
  url: '/trade/patch/' + data.id,
  method: 'patch',
  data
})
export const updateStoreState = store => request({
  url: '/stores'
})

export const getStoreById = id => request({
  url: `/stores/stores/${id}`
})

export const getStoreImages = id => request({
  url: `/images/list/${id}`
})

export const getPie = () => request({
  url:'/dataanalysis/list'
})

// 商品类别
export const getGoodsClassList = () => request({
  url: '/shopsclass/list',
  method: 'get'
})

export const delGoodsClassList = id => request({
  url: `/shopsclass/delete/${id}`,
  method: 'DELETE'
})

export const editGoodsClassList = data => request({
  url: `/shopsclass/update/${data.id}`,
  method: 'PATCH',
  data: data
})

export const addGoodsClassList = data => request({
  url: '/shopsclass/add',
  method: 'post',
  data: data
})

// 商品子类别
export const getChildGoodsClassList = () => request({
  url: '/shopschild/list',
  method: 'get'
})

export const delChildGoodsClassList = id => request({
  url: `/shopschild/delete/${id}`,
  method: 'DELETE'
})

export const editChildGoodsClassList = data => request({
  url: `/shopschild/update/${data.id}`,
  method: 'PATCH',
  data: data
})

export const addChildGoodsClassList = data => request({
  url: '/shopschild/add',
  method: 'post',
  data: data
})
